package com.sn.pw.controller;



import com.sn.pw.result.Result;
//import com.sn.pw.service.UserService;
import com.sn.pw.service.UserService;
import com.sn.pw.vo.req.LoginReq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RequiredArgsConstructor(onConstructor_ = @Autowired)
@Api(value = "登录相关-Api",tags = "登录相关-Api")
@RestController
@RequestMapping("/login")
public class LoginController {

    private final UserService userService;

    @PostMapping("/userLogin")
    @ApiOperation(value = "用户登录")
    public Result userLogin(@Valid @RequestBody LoginReq param){
         userService.userLogin(param);
        return Result.success("登录成功！");
    }

}
